<?php
class RobotGetRandomShopAction extends SzAbstractAction
{
    protected $paramTypes = array(
        SzAbstractAction::TYPE_INT,
        SzAbstractAction::TYPE_INT
    );

    /**
     * Harvest a plant.
     *
     * @param int $userId
     * @param int $reqTime
     * @return SzResponse
     */
    public function execute($userId, $reqTime)
    {
        GameService::get()->validateMultiRequestTimeDelta($userId, $reqTime);
        if (!GameService::get()->verifySysUnlock($userId, GameConst::FUNC_TRANSACTION_FUNC)) {
            return $this->buildResponse(false);
        }
        $randomShop = ShopService::get()->refreshRandomShop($userId, GameConst::RANDOM_SHOP_ROBOT);
        return $this->buildResponse(array(
            'randomShop' => $randomShop->toArray()
        ));
    }
}